package us.icitap.commandcenter.business.ejb;

import java.util.Date;
import java.util.List;

import javax.ejb.Local;
import javax.persistence.EntityManager;

import us.icitap.commandcenter.business.ejb.persistence.Call;
import us.icitap.commandcenter.business.ejb.persistence.CommandCenter;
import us.icitap.commandcenter.business.ejb.persistence.Dispatcher;
import us.icitap.dao.Expression;
import us.icitap.dao.IPersistenceFacade;
import us.icitap.utils.Result;

@Local
public interface ICallPersistBean extends IPersistenceFacade{

	public Result<Call> createCall(Call call);
	public Result<List<Dispatcher>> getDispatchers(CommandCenter cc);
	public Result<List<Object[]>> findCallsTotalBasedOnStatus(CommandCenter commandCenter, Date minDate, Date maxDate);
	public Result<Call> generateUniqueNumber(Call call);
	public abstract <T> Result<T> saveEntity(T entity);

	public abstract <T> Result<List<T>> getList(Class<T> entityClass,
			boolean withStatus, String orderBy);

	public abstract <T> Result<List<T>> findByCriteria(
			List<Expression> expressions, String groupByFields,
			String sortFields, Class<T> entity);

	public abstract <T> Result<T> findEntityById(Object id, Class<T> entity);
	String generateUNString();
	Result<Long> findUniqueNumberTotal(CommandCenter commandCenter);

	
}
